namespace Framework
{
    using System;
    using UnityEngine;

    public class DestroyWatcher : MonoBehaviour
    {
        public AssetLoadResult UnloadToken;
        public Action<DestroyWatcher> Callback;
        private void OnDestroy()
        {
            Callback?.Invoke(this);
        }
    }
#if UNITY_EDITOR
    [UnityEditor.CustomEditor(typeof(DestroyWatcher))]
    public class DestroyWatcherEditor : UnityEditor.Editor
    {
        public override void OnInspectorGUI() { }
    }
#endif
}